package ch07;

class _12_CastingTest2 {
	public static void main(String args[]) {
		Car car = new Car();
		Car car2 = null;
		FireEngine fe = null;

		car.drive();
		fe = (FireEngine) car; // runtime error
		fe.drive();
		fe.water();
		car2 = fe;
		car2.drive();
	}
}
/*
 * drive, Brrrr~ Exception in thread "main" java.lang.ClassCastException:
 * ch07.Car cannot be cast to ch07.FireEngine at
 * ch07._12_CastingTest2.main(_12_CastingTest2.java:9)
 */